﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;

namespace LinkyPOS.Class
{
    class kullanicilar
    {
        private string username;
        private string password;
        private string islemid;

        public string Username { get { return username; } set { username = value; } }
        public string Password { get { return password; } set { password = value; } }
        public string Islemid { get{ return islemid;} set { islemid = value; } }



        public bool kontrol()
        {
            bool durum = false;
            try
            {
                SqlConnection sqlcon = connection.baglanti;
                SqlCommand sqlcmd = new SqlCommand("select * from kullanicilar where userID=@userID and password=@password",sqlcon);
                sqlcmd.Parameters.AddWithValue("@userID", username);
                sqlcmd.Parameters.AddWithValue("@password", password);

                sqlcon.Open();
                SqlDataReader sdr = sqlcmd.ExecuteReader();
                while (sdr.Read())
                {
                    durum = true;
                    
                }

                sqlcon.Close();
                return durum;
            }
            catch (Exception)
            {

                return durum;
            }

        }




    }
}
